<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty ht modifier plugin
 *
 * Type:     modifier<br>
 * Name:     time<br>
 * Purpose:  Substr a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.time.php
 *          time (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
//
function smarty_modifier_ht($string, $type = '')
{
	include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'house.types.class.php');
	$htutil = new HouseTypesUtil();
	$type_options = $htutil->getFormat($type);
	if( is_array($type_options) ) {
		foreach($type_options as $k => $v) {
			if( $k == $string ) {
				$_val = $v;
				break;
			}
		}
	}
	
	global $LANGUAGE;
	$_val = (isset($_val) && isset($LANGUAGE['house']['type'][$_val])) ? $LANGUAGE['house']['type'][$_val] : $_val;
	
	return $_val;
}
//
?>